import { defineConfig } from "vite";
import vue from "@vitejs/plugin-vue";
import { resolve } from "path";
import { excludeAppsPlugin } from './src/core/utils/excludeAppsPlugin'; // 引入插件


// https://vite.dev/config/
export default defineConfig({
  base: "./",
  plugins: [vue(), excludeAppsPlugin()],
  server: {
    port: 3000,
    open: true,
  },
  resolve: {
    alias: {
      "@": resolve(__dirname, "src"),
      "@core": resolve(__dirname, "src/core"),
      "@apps": resolve(__dirname, "src/apps"),
    },
  },
  build: {
    outDir: 'dist/main',
    // lib: {
    //   entry: resolve(__dirname, 'src/main.ts'),
    //   name: 'main',
    //   formats: ['es']
    // },
    rollupOptions: {
      // input: {
      //   main: resolve(__dirname, 'src/main.ts')
      // },
      // 排除子模块依赖
      external: [],

    }
  }
});
